package com.azt.front.utils;

import com.azt.api.pojo.User;

/**
 * 将用户信息绑定到线程中
 * Created by shangwq on 2016/12/7.
 */
public class UserContext {

    private static final ThreadLocal<User> local = new ThreadLocal<User>();

    public static void setUser(User user) {
        local.set(user);
    }

    public static User getUser() {
        return local.get();
    }

    public static void clear() {
        local.remove();
    }
}
